<style>
    h1,
    h2 {
        color: red;
    }

    h1:has(+ h2) {
        color: blue;
    }

    p:has(span) {
        color: aqua;
    }

    p:has(.red){
        color: red;
    }
</style>
<section>
    <article>
        <h1>Morning Times</h1>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
            magna aliqua.</p>
    </article>
    <article>
        <h1>Morning Times</h1>
        <h2>Delivering you news every morning</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
            magna aliqua.
            <span>span</span>
        </p>
        <p>
            这是p元素
            <a class="red">class red</a>
        </p>
    </article>
</section>